package com.demo.mongo.entity;

import com.demo.mongo.annontion.AutoIncKey;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.lang.annotation.Documented;
import java.util.Date;

/**
 * 测试使用 mongo 文档
 *
 * @author YT
 * @date 2019-08-19
 */
@Data
@Document(collection = "test")
public class Test implements Serializable {

    @AutoIncKey
    @Id
    private String id;

    @Field
    private String name;

    @Field
    private String age;

    @Field
    private String address;

    @Field
    private Date createTime;
}
